local skel = fk.CreateSkill{
  name = "lb_zero__mowang",
  tags = {Skill.Compulsory}
}

Fk:loadTranslationTable{
  ["lb_zero__mowang"] = "默往",
  [":lb_zero__mowang"] = "<b>锁定技</b>，你与你本轮使用过的牌名相同的手牌视为雷【杀】，这些牌不计入手牌上限且使用时无法被响应。",

  ["@$lb_zero__mowang-round"] = "默往",

  ["$lb_zero__mowang1"] = "清楚目标。",
  ["$lb_zero__mowang2"] = "雷霆！",
}

skel:addEffect(fk.PreCardUse, {
  anim_type = "offensive",
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(skel.name) and target == player and table.contains(data.card.skillNames, skel.name)
  end,
  on_use = function(self, event, target, player, data)
    data.disresponsiveList = player.room.players
  end,
})

skel:addEffect(fk.AfterCardUseDeclared, {
  can_refresh = function(self, event, target, player, data)
    return player:hasSkill(skel.name, true) and target == player
  end,
  on_refresh = function(self, event, target, player, data)
    player.room:addTableMarkIfNeed(player, "@$lb_zero__mowang-round", data.card.trueName)
  end,
})

local canUseTime = function (player, card)
    return player:hasSkill(skel.name) and table.contains(player:getCardIds("h"), card.id)
    and table.contains(player:getTableMark("@$lb_zero__mowang-round"), card.trueName)
end

skel:addEffect("filter", {
  card_filter = function (self, card, player, isJudgeEvent)
    return canUseTime(player, card)
  end,
  view_as = function(self, player, card)
    local slash = Fk:cloneCard("thunder__slash", card.suit, card.number)
    slash.skillName = skel.name
    return slash
  end,
})

skel:addEffect("maxcards", {
  exclude_from = function (self, player, card)
    return canUseTime(player, card)
  end,
})

skel:addAcquireEffect(function (self, player, is_start)
  local room = player.room
  local list = {}
  room.logic:getEventsOfScope(GameEvent.UseCard, 1, function (e)
    local use = e.data
    if use.from == player then
      table.insertIfNeed(list, use.card.trueName)
    end
  end, Player.HistoryRound)
  room:setPlayerMark(player, "@$lb_zero__mowang-round", #list == 0 and 0 or list)
end)

skel:addLoseEffect(function (self, player, is_death)
  player.room:setPlayerMark(player, "@$lb_zero__mowang-round", 0)
end)

return skel